<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2018/2/27
 * Time: 22:26
 */

namespace App\Http\Controllers\Api;


use App\Http\Controllers\Controller;

class TestController extends Controller
{
    public function send(){
//        $client = new swoole_http_client($ip, 80);
//        if(!$client->connect('127.0.0.1', 9502))
//        {
//            exit("connect failed\n");
//        }
//        echo $client->send('"message":"1","user_id":1,"room_id":1,"type":"message"');
//        $data = $client->recv(7000, 0);
//        if($data === false)
//        {
//            echo "recv fail\n";
//
//        }
//        var_dump($data);

        var_dump(\Swoole::getInstance());
    }
}